/*
 * 作者: 董绘峰
 * 时间: 2017-02-09 
 * 说明：
 * Copyright (c) 2016-2017 中研沃兮
 */

define(function(require) {

	require("jquery");

	var c = require('app/utils/CommonUtils');
	var appInfo = require('app/AppInfo');
	var CacheUtils = require('app/utils/CacheUtils');
	var action = require('./action/RoomHeaderFrmAction');
	var EventUtils = require('app/utils/EventUtils');
	var param = api.pageParam;
	
	$("#closeWin").click(function(){
		
		
	   	api.setScreenOrientation({
    		orientation: 'portrait_up'
		});
		EventUtils.send('root', 'reset');
		api.closeWin({
        });

	});
	
	
	var thumb = param.thumburl;
	if(!c.isNullStr(thumb)){
		$("#head-id").attr('src',CacheUtils.imageCache(c.handleUrl(thumb))); 
	}
	
	var item = param;
	
	if (item.type == "3") {
		$("#livetext").html("回顾");
		$("#statusdoc").css("color","green");
	
	} else if (item.type == "1") {

		var now = new Date().getTime();
		if (now < item.time) {
			status_div =
				$("#livetext").html("未开始直播");
				$("#statusdoc").css("color","red");
		} else {

			if (now < item.endtime) {
				$("#livetext").html("直播");
				$("#statusdoc").css("color","green");
			} else {
				$("#livetext").html("回顾");
				$("#statusdoc").css("color","green");
			}
		}
	}
	
	
	
	if(param.liveType == "1"){
		$("#liveStatus").show();
	}else{
		$("#liveStatus").hide();
	}

	
	
	return;
}); 